=========================================================================================================
   Mine Field
   Version: 1.4.1
   Author: Kronzky (www.kronzky.info / kronzky@gmail.com)
  
   Fills a marker-defined area with mines
  
---------------------------------------------------------------------------------------------------------
  
  Installation:
  
   To use the included demo missions, copy them (including their paths) into your user mission folder. 
   This will be either
   	\My Documents\ArmA\Mission  or 
   	\My Documents\ArmA Other Profiles\[profile name]\Missions
  
   To use this script in other missions, place it either into your central script folder,
   or into the respective mission folder.
   
   The central script folder will be at:
   	\My Documents\ArmA\Scripts  or
   	\My Documents\ArmA Other Profiles\[profile name]\Scripts.
   (most likely this folder doesn't exist yet, so you would have to create it first)
  
---------------------------------------------------------------------------------------------------------
  
  Usage:
  
  1. Create a rectangular marker to define the area to be mined.
  2. Call the script (either from the init.sqf, or from a unit's or game logic's init line) with the
     marker's name as the first argument:  nul=["areamarker"] execVM "minefield.sqf"
  
    (If you are using this script for a MP mission, you need a game-logic named "server" somewhere 
    on the map, and you MUST have to defined the respawn option in description.ext.)
       
---------------------------------------------------------------------------------------------------------
  
  Required parameter:
       "areamarker" : Name of marker that designates the area to be covered.
                      The marker has to be a rectangle, and can be rotated.
                      Do not use special symbols in the marker name ("_" is ok, "-",":","/",etc. aren't)
  
  Optional parameters: (default values in parenthesis)
   Most options are defines via a paired argument: name:,value
    In that case the parameter name is always enclosed in quotation marks, and it ends with a colon ("trigger:")
    It is followed by the parameter value - either a number, or a string, which is enclosed in quotation marks.
    So, to define the number of mines for example, you would enter ["marker","count:",50]
  
       trigger:,string   : The type of unit that should activate the trigger.
       ("Land")            Typically, this would be something like "Land", "Man", "LandVehicle" or "Tank".
                           A complete list of vehicle types is available at the Wiki: 
                             http://community.bistudio.com/wiki/ArmA:_CfgVehicles 
                           nul=["marker", "trigger:","Man"] execVM ...
                        
       side:,string      : Which side the mine should be triggered by.
       ("ANY")             Sides can be: "ANY", "EAST", "WEST", "GUER" or "CIV"
                           nul=["marker", "side:","CIV"] execVM ...
                        
       density:,number   : How densely the area should be filled with mines.
       (10)                The number defines the square meters per mine.
                           nul=["marker", "density:",5] execVM ...
                        
       count:,number     : You can also define an *absolute* number of mines to use.
                           nul=["marker", "count:",50] execVM ...

       grid:,number      : Instead of randomly positioned mines, you can also set them up in a grid.
                           In this case the parameter value will define the distance between them (density or count are ignored).
                           nul=["marker", "grid:",1] execVM ...
                        
       range:,number     : How close a unit has to be to activate the trigger.
       (.75)               nul=["marker", "range:",5] execVM...
  
       ammo:,string      : What type of ammo to use to create the mine explosion.
       (depends)           A list of available ammunition types is available at the Wiki: 
                             http://community.bistudio.com/wiki/ArmA:_Weapons#Vehicle_Weapons (use the name from the ammo column)
                           Keep in mind that the damage depends on the type of unit (infanty, vehicle), so you will have to 
                           experiment a bit to find the proper explosion. "HE" ammo normally works best.
                           The default ammo used depends on the trigger class: Land,Man=G_40mm_HE, LandVehicle=R_Hydra_HE, Tank=Sh_125_HE
                           nul=["marker", "ammo:","R_Hydra_HE"] execVM...
                        
       mine:,string      : Class name of the visible mine object that should be created. 
       ("Mine")            The two that are currently available in ArmA are "Mine" and "MineE", 
                           but you can also use any other objects, or addon elements.
                           For invisible mines, use "HeliHEmpty" (don't use "Logic" as it takes up more system resources).
                           nul=["marker", "mine:","MineE"] execVM ...
  
       height:,number    : The height the mine should be placed at.
       (depends)           A good height for Western mines ("Mine") is 0.00, and 0.025 for Eastern ones ("MineE").
                           These are also the values taken as default heights.
                           nul=["marker", "height:",0.1] execVM ...
  
       showsigns:,string : Create warning signs at the corners of the mined area.
                           The value defines the object name (class) to be used as a warning sign.
                           This can be, for example, "Danger", "DangerEast" or "DangerWest", or any addon sign available.
                           nul=["marker", "showsigns:","Danger"] execVM ... 
                       
       showmarker        : By default the marker that's used to designate the area is hidden after the script initialization.
                           To keep the marker visible, user "SHOWMARKER".
                           nul=["marker", "showmarker"] execVM ...
  
  
   Some examples:
   nul=["marker", "trigger:","LandVehicle", "range:",5]... 
       create mines with a range of 5 meters, that are triggered by any vehicles (cars & tanks)
   nul=["marker", "trigger:","Tank", "ammo:","Sh_120_HE", "mine:","MineE", "height:",0.025]... 
       create Eastern-style anti-tank mines 
   nul=["marker", "trigger:","Land", "range:",5, "ammo:","Bo_GBU12_LGB", "mine:","RoadCone"]... 
       create road cones which will detonate a massive bomb if anybody comes within 5 meters
  
---------------------------------------------------------------------------------------------------------
  
  If you are using the default ArmA mines ("Mine" or "MineE"), they can be defused by units
  in the qualified classes (e.g. Engineers, Special Forces).
  
  Exploding mines can cause nearby other mines to detonate as well, causing a chain reaction.
  
---------------------------------------------------------------------------------------------------------

  Several global variables exist within the script which could also be used to fire external triggers:
  KRON_MF_Tot       : Contains the count of the still active mines overall.
  KRON_MF_[areaname]: For each area there exists a variable that contains the number of 
                      active mines left in it. 
  KRON_MF_Mines     : (only available in Single-Player games)
                      Contains a list of all active mines. 
                      This is a nested array where each mine is defined by a 3-dimensional array.
                      This sub-array contains the object, index number and area name for each mine.
                      If a mine explodes or is disarmed, its entry is removed from this list.

---------------------------------------------------------------------------------------------------------

  The script comes with a function to clear all the mines in an area at once (SP only):
    [areaname,method] call KRON_MF_Clear
   The parameters for this function are:
    areaname = The name of the marker that defines this area
    method   = If you want all mines to be detonated, enter "explode" as the second parameter
               If there is no second parameter the mines will just quietly be removed.
  
=========================================================================================================
